﻿using System.Configuration;
using System.Web.Mvc;
using ZBJF.Warranty.Common.Enums;
using ZBJF.Warranty.WebProvider.Filter;

namespace ZBJF.Warranty.CustomerService
{
    public class FilterConfig
    {
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            //filters.Add(new HandleErrorAttribute());
            filters.Add(new ControllerErrorLogExceptionAttribute());
            filters.Add(new LoginFilterAttribute() { IsCheck = true, ApplicationType = ApplicationType.CustomerServiceSite });//登录验证
            filters.Add(new AuthenticationFilterAttribute { NeedAuthentication = ConfigurationManager.AppSettings["NeedAuthentication"] == "true" });//权限验证、身份验证
            filters.Add(new ControllerErrorLogExceptionAttribute());
        }
    }
}
